package com.example.administrator.mydemo;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;

public class MainActivity extends AppCompatActivity {

    private String name;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        setName();
        getName();
    }

    private void setName() {
        name = "小明";
    }

    public String getName() {
        return name;
    }
}
